<h:form id="formOrigem" 
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:pe="http://primefaces.org/ui/extensions"
        xmlns:f="http://java.sun.com/jsf/core">

    <script language="JavaScript" src = "scripts/script.js"/>

    <h:panelGrid columns="2">
        <h:panelGroup>
            <h:outputLabel value="Cat. Econômica" /><br/>
            <p:selectOneMenu value="#{origemBean.origem.categoriaEconomicaDeReceita}" 
                             style="width: 220px">
                <f:selectItem itemLabel="Selecione" />
                <f:selectItems value="#{origemBean.categoriasEconomicaDeReceita}" />
                <f:converter converterId="simpleEntityConverter" />
            </p:selectOneMenu>
        </h:panelGroup>
        <h:panelGroup>
            <h:outputText value="Código" /><br/>
            <p:inputMask value="#{origemBean.origem.codigo}" 
                         styleClass="up"
                         style="width: 50px"
                         mask="9"
                         required="true"
                         requiredMessage="Campo código requerido"/><br/>
        </h:panelGroup>
    </h:panelGrid>

    <h:panelGrid columns="1"
                 style="width: 96%">
        <h:panelGroup>
            <h:outputText value="Descrição" /><br/>
            <p:inputText value="#{origemBean.origem.descricao}" 
                         style="width: 100%"
                         required="true"
                         requiredMessage="Campo descrição requerido"
                         styleClass="up" /><br/>
        </h:panelGroup>
    </h:panelGrid>

    <hr/>

    <p:commandButton id="btnGravar" value="Gravar" 
                     actionListener="#{origemBean.adicionarEditarFim}"
                     update="formOrigem" />

    <p:commandButton value="Cancelar" 
                     actionListener="#{origemBean.cancelar}"
                     immediate="true"/>

</h:form>


